<extend name="Public:Base" />
<block name="content">
	<style type="text/css">
	.list{margin-top: 5px;}
	.list li {list-style: none;display: inline-block;margin-left: 10px;width: 200px;}
	label{cursor: pointer;}
	.form{
		border-top:1px solid #CCCCCC;
		padding-top: 10px;
	}
	</style>
	<div class="main-title">
		<h2>备份还原</h2>
	</div>
	<div class="tab-wrap">
		<ul class="tab-nav nav">
			<li class="current"><a href="#">备份</a></li>
			<li><a href="#">还原</a></li>
		</ul>
		<div class="tab-content" id="beifen">
			<form method="post" class="form-horizontal" name="ReservedForm1" action="__url__/reserved">
				<div class="form-item">
					<label class="item-label"></label>
					<div class="controls">
						<label><input type="checkbox" value="send" name="is_email" />备份完成后发送到邮箱</label>
						<input type="text" name="email" class="text input-large" value="{:c('web_mail')}" />
					</div>
				</div>
				<div class="form-item">
					<label class="item-label"></label>
					<div class="controls">
					<label><input type="checkbox" value="download" name="is_download" />备份完成后立刻下载到本地</label>
					</div>
				</div>
				<div class="form-item">
					<label class="item-label"></label>
					<div class="controls">
						<ul class="list">
							<volist name="dblist" id="vo" >
							<li>
								<input type="checkbox" value="{$vo}" name="tobackup[]" id="tobackup{$i}" checked />
								<label for="tobackup{$i}">{$vo}</label>
							</li>
							</volist>
						</ul>
					</div>
				</div>
				<div class="form-item">
					<label class="item-label"></label>
					<div class="controls">
						<button type="submit" class="btn submit-btn ajax-post" target-form="form-horizontal">开始备份</button>
					</div>
				</div>
			</form>
		</div>
		<div class="tab-content" id="huanyuan">
			<form method="post" class="form-horizontal" name="RestoreForm1" action="__url__/restore">
				<?php
					foreach(glob('./BACKUP/*') as $v){
						if(is_dir($v)){
							$backlist[]= $v;
							//str_replace('_',':',str_replace('./BACKUP/', '', $v)).'</label></p>';
						}
					}
				?>
				<volist name="backlist" id="bvo" >
					<div class="form-item">
						<label class="item-label"></label>
						<div class="controls">
							<label>
								<input type="radio" value="{$bvo}" name="torestore" id="torestore{$i}"/>
								<label for="torestore{$i}">{$bvo|str_replace='./BACKUP/', '',###|str_replace='_',':',###}
							</label>
						</div>
					</div>
				</volist>
				<div class="form-item">
					<label class="item-label"></label>
					<div class="controls">
						<button type="submit" class="btn submit-btn ajax-post">开始还原</button>
					</div>
				</div>
			</form>
		</div>
	</div>
	<div class="page"><div>{$page}</div></div>
</block>
<block name="__body">
	<script type="text/javascript">
	$('.nav li').click(function(){
		var i=$('.nav li').index($(this));
		$('.nav li').removeClass('current');
		$(this).addClass('current');
		$('.tab-content').hide();
		$('.tab-content:eq('+i+')').show();
	});
	</script>
</block>